
SELECT SUM(QTDE_ENTRADA) AS QTDE 
FROM	LOJA_ENTRADAS A      
	INNER JOIN LOJA_ENTRADAS_PRODUTO B 
		ON A.ROMANEIO_PRODUTO = B.ROMANEIO_PRODUTO AND A.FILIAL = B.FILIAL 
WHERE	A.FILIAL = 'billabong_001' 
AND		A.EMISSAO >= '2009-10-26 00:00:00:000'
AND     A.EMISSAO <= '2009-10-26 00:00:00:000'

----------------------


SELECT SUM(QTDE_TOTAL) AS EFETIVO 
FROM	LOJA_ENTRADAS 
WHERE	FILIAL = 'billabong_001' 
AND		EMISSAO >= '2009-10-26 00:00:00:000' 
AND		EMISSAO <='2009-10-26 00:00:00:000'
AND     ENTRADA_CONFERIDA = 1

-----------------------------------------

SELECT SUM(QTDE_TOTAL) AS DIFERENCA 
FROM	LOJA_ENTRADAS_DIF 
WHERE	FILIAL = 'billabong_001' 
AND		EMISSAO >= '2009-10-26 00:00:00:000'
AND		EMISSAO <= '2009-10-26 00:00:00:000'

-------------------------------------------


